import com.sun.org.apache.regexp.internal.RE;

import java.util.Scanner;

public class Demo10 {
    public static void main(String[] args) {
        while (true){
            Scanner scanner = new Scanner(System.in);
            String str = scanner.nextLine();
            String encode = encode(str);
            System.out.println(encode);
            String decode = decode(encode);
            System.out.println(decode);
        }
    }
    public static String encode(String str){
        int len = str.length();
        int cur = 0;
        StringBuilder encode = new StringBuilder();
        while (cur < len){
            char c = str.charAt(cur);
            if (c < '0'  || c > '9'){
                if (c == '_') {
                    encode.append("\\" + "U" + "L");
                    cur++;
                    if (cur != len){
                        encode.append("_");
                    }
                }else {
                    encode.append(c);
                    cur++;
                    if (cur != len){
                        encode.append("_");
                    }
                }
            }else {
                if (cur + 1 == len){
                    encode.append(str.charAt(cur));
                    cur++;
                }else if (c > '0'){
                    int n = c - '0';
                    char next = str.charAt(cur + 1);
                    for (int i = 0; i < n + 1; i++) {
                        encode.append(next);
                    }
                    encode.append("_");
                    cur++;
                }
            }
        }
        return encode.toString();
    }
    public static String decode(String str){
        int len = str.length();
        int cur = 0;
        StringBuilder decode = new StringBuilder();
        while (cur < len){
            char c1 = str.charAt(cur);
            int count = 0;
            if (cur + 1 < len) {
                char c2 = str.charAt(cur+1);
                if (c2 == c1){
                    while (str.charAt(cur + 1) == c1){
                        count ++;
                        cur ++;
                    }
                    if (c1 == '_'){
                        count--;
                        cur--;
                    }
                    String num = count + "";
                    decode.append(num);
                    cur += 2;
                } else if (c2 == '_') {
                    decode.append(c1);
                    cur += 2;
                }else {
                    decode.append("_");
                    cur += 4;
                }
            }else {
                decode.append(c1);
                cur ++;
            }
        }
        return decode.toString();
    }
}
